// DropletData.h

#ifdef _WIN32
#pragma once
#endif

#ifndef _DROPLET_DATA_
#define _DROPLET_DATA_

#ifdef _WIN32
#include "inttypes.h"
#endif

#include "Message.h"

#include <map>
#include <deque>

#define DROPLET_MAX_SPEED 255

namespace Droplets
{
	enum LoadedPrograms
	{
		PROGRAM_1,
		PROGRAM_2,
		PROGRAM_3,
		PROGRAM_4,
		PROGRAM_5
	};

	struct DropletThreadData
	{
		uint16_t dropletID;
		LoadedPrograms program;
	};

	struct DropletStateData
	{
		// x , y = coordinates on map
		// dx, dy = delta values to add to x and y per iteration step
		// tx, ty = target x and y per move command
		// tx = ((Cos(moveDir) * speed * time) + x1)
		// dx = tx / time
		// ty = ((Sin(moveDir) * speed * time) + x1)
		// dy = ty / time
		float x, y, dx, dy, tx, ty, moveDir;
		float a, da, ta;	// a = orientation on map. ta, da are analogous to tx/ty, dx/dy.
		uint8_t speed;
		bool moving, rotating;

		uint8_t rBt, gBt, bBt;

		uint16_t powCapacitor, powIRTransmit;
		int8_t powFrontLeg, powRearLeftLeg, powRearRightLeg;	// -1, 0 , 1
		int8_t powMotor1, powMotor2, powMotor3;		// -1, 0, 1

		std::deque<Droplets::Message> inMsgList;
		std::deque<Droplets::Message> outMsgList;
		uint16_t robotID;
	};

}

#endif